package org.springside.examples.miniweb.entity.dictionary;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.springside.examples.miniweb.entity.IdEntity;

/**
 * DictionaryClass.
 */
@Entity
@Table(name = "s_dictionary_class")
@JsonIgnoreProperties({"hibernateLazyInitializer","remark","code","chineseTableName","englishTableName","available"})
public class DictionaryClass extends IdEntity {

	private String remark;
	private String code;
	private String name;
	private String chineseTableName;
	private String englishTableName;
	private String available;
	private Set<DictionaryDetail> dictionaryDetails = new HashSet<DictionaryDetail>(0);

	public DictionaryClass() {
	}

	@Column(name = "remark", length = 65535)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "code", length = 100)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "name", length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "chineseTableName", length = 100)
	public String getChineseTableName() {
		return this.chineseTableName;
	}

	public void setChineseTableName(String chineseTableName) {
		this.chineseTableName = chineseTableName;
	}

	@Column(name = "englishTableName", length = 100)
	public String getEnglishTableName() {
		return this.englishTableName;
	}

	public void setEnglishTableName(String englishTableName) {
		this.englishTableName = englishTableName;
	}

	@Column(name = "available", length = 10)
	public String getAvailable() {
		return this.available;
	}

	public void setAvailable(String available) {
		this.available = available;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dictionaryClass")
	@OrderBy(value="sort")
	public Set<DictionaryDetail> getDictionaryDetails() {
		return this.dictionaryDetails;
	}

	public void setDictionaryDetails(Set<DictionaryDetail> dictionaryDetails) {
		this.dictionaryDetails = dictionaryDetails;
	}
}
